package com.moli.iov.common.mongodb.properties;

import lombok.Data;
import org.springframework.boot.autoconfigure.AutoConfigurationPackage;
import org.springframework.boot.autoconfigure.AutoConfigureBefore;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

import java.util.List;

import static com.moli.iov.common.mongodb.constants.MongoConstant.AUTO_PREFIX;

/**
 *
 * Mongo of properties.
 *
 * @author OAK
 * @version 3.0.1
 * @since 2019/12/13 9:56 PM.
 *
 */
@Data
@AutoConfigurationPackage
@ConfigurationProperties(AUTO_PREFIX)
public class MongoDbProperties {

    private List<String> uris;

    private String database;

    private String description;

    private String applicationName;

    private Integer minConnectionsPerHost;

    private Integer connectionsPerHost;

    private Integer threadsAllowedToBlockForConnectionMultiplier;

    private Integer serverSelectionTimeout;

    private Integer maxWaitTime;

    private Integer maxConnectionIdleTime;

    private Integer maxConnectionLifeTime;

    private Integer connectTimeout;

    private Integer socketTimeout;

    private Boolean socketKeepAlive;

    private Boolean sslEnabled;

    private Boolean sslInvalidHostNameAllowed;

    private Boolean cursorFinalizerEnabled;

    private Boolean alwaysUseMBeans;

    private Integer heartbeatFrequency;

    private Integer minHeartbeatFrequency;

    private Integer heartbeatConnectTimeout;

    private Integer heartbeatSocketTimeout;

    private Integer localThreshold;

}
